package com.dailywork.basepro.scope;

public class ScopeSelf1 extends Base {

    public static void main(String[] args) {
        testBase1();
        testExends2();
    }

    private static void testBase1() {
        Base base = new Base();
        base.setId(10);
        //        base.id=9; 同一个包内private属性不能直接访问
        base.name = "lky"; // 同一个包内protect属性可以直接访问
        System.out.println(base);
    }

    private static void testExends2() {
        ScopeSelf1 scopeSelf1 = new ScopeSelf1();
        scopeSelf1.name = "lky"; // protect属性在子类中可见，可以直接访问
        scopeSelf1.setId(10); // private属性在子类中不可见，不能直接访问
        System.out.println(scopeSelf1);
    }
}
